package SV_DATA_FILE;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import java.io.*;
import java.util.UUID;


public class Fixed_01 {
    private static final Object UPLOAD_DIRECTORY_STRING = "";

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream()));
        String pLine = br.readLine();
        String filename = UUID.randomUUID().toString();
        BufferedWriter bw = new BufferedWriter(new FileWriter(UPLOAD_DIRECTORY_STRING + filename, true));

        for (String line; (line=br.readLine())!=null; ) {
            int boundary = 0;
            if (line.indexOf(boundary) == -1) {
                bw.write(line);
                bw.newLine();
                bw.flush();
            }
        }
        bw.close();
    }
}
